# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest do
  @moduledoc """
  The set of requests for updating aspects of a Label. If any request is not valid, no requests will be applied.

  ## Attributes

  *   `languageCode` (*type:* `String.t`, *default:* `nil`) - The BCP-47 language code to use for evaluating localized Field labels when `include_label_in_response` is `true`.
  *   `requests` (*type:* `list(GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest.t)`, *default:* `nil`) - A list of updates to apply to the Label. Requests will be applied in the order they are specified.
  *   `useAdminAccess` (*type:* `boolean()`, *default:* `nil`) - Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the Label before allowing access.
  *   `view` (*type:* `String.t`, *default:* `nil`) - When specified, only certain fields belonging to the indicated view will be returned.
  *   `writeControl` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2WriteControl.t`, *default:* `nil`) - Provides control over how write requests are executed.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :languageCode => String.t() | nil,
          :requests =>
            list(
              GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest.t()
            )
            | nil,
          :useAdminAccess => boolean() | nil,
          :view => String.t() | nil,
          :writeControl =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2WriteControl.t() | nil
        }

  field(:languageCode)

  field(:requests,
    as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest,
    type: :list
  )

  field(:useAdminAccess)
  field(:view)
  field(:writeControl, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2WriteControl)
end

defimpl Poison.Decoder,
  for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest do
  def decode(value, options) do
    GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
